%% FUNCTION: calcMTOW
% Function that iterates a new value of the MTOW
%
% INPUT:
%   aircraft
%       weight.crew [int]:
%       weight.payload [int]:
%       weight.empty [int]:
%       weight.mtow [int]:
% OUTPUT:
%

function [maxTakeOffWeightLb] = calcTakeOffWeight (aircraft, fuelWeightFraction)
   
% Weights from the structure aircraft
maxTakeOffWeightLb = aircraft.weights.mtow;
crewWeightLb = aircraft.weights.crew;
payloadWeightLb = aircraft.weights.payload;
emptyWeightLb = aircraft.weights.empty;

% Get the fuel weight, including the reserve fuel
fuelWeightLb = fuelWeightFraction * maxTakeOffWeightLb;

% Calculate the new value of the MTOW
maxTakeOffWeightLb = crewWeightLb + payloadWeightLb + fuelWeightLb + emptyWeightLb;

return